// 请自行创建 screeps.config.ts 文件，或者运行 yarn run config 生成
import config from './screeps.config'

/**
 * 白名单
 */
export const WhiteList = new Set([...(config.whiteList || []), ...(Memory.whiteList || [])])

/**
 * 战斗配置
 */
export const BattleConfig: Exclude<ScreepsConfig['battleConfig'], undefined> = {
    test: [
        {
            body: [
                [TOUGH, 4],
                [RANGED_ATTACK, 3],
                [MOVE, 8],
                [HEAL, 1],
            ],
        },
        {
            body: [
                [TOUGH, 4],
                [RANGED_ATTACK, 3],
                [MOVE, 8],
                [HEAL, 1],
            ],
        },
        {
            body: [
                [TOUGH, 4],
                [MOVE, 8],
                [HEAL, 4],
            ],
        },
        {
            body: [
                [TOUGH, 4],
                [MOVE, 8],
                [HEAL, 4],
            ],
        },
    ],
    r1t3: [
        {
            body: [
                [TOUGH, 12],
                [RANGED_ATTACK, 5],
                [HEAL, 23],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    r4t3: [
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [RANGED_ATTACK, 14],
                [TOUGH, 10],
                [RANGED_ATTACK, 6],
                [HEAL, 10],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [RANGED_ATTACK, 14],
                [TOUGH, 10],
                [RANGED_ATTACK, 6],
                [HEAL, 10],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    w2h2: [
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [WORK, 14],
                [TOUGH, 10],
                [WORK, 16],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [WORK, 14],
                [TOUGH, 10],
                [WORK, 16],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    arh2: [
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [ATTACK, 14],
                [TOUGH, 10],
                [ATTACK, 16],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [RANGED_ATTACK, 14],
                [TOUGH, 10],
                [HEAL, 16],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    a1h1: [
        {
            body: [
                [ATTACK, 10],
                [TOUGH, 13],
                [ATTACK, 17],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    w1h1: [
        {
            body: [
                [WORK, 10],
                [TOUGH, 13],
                [WORK, 17],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
        {
            body: [
                [TOUGH, 13],
                [HEAL, 27],
                [MOVE, 10],
            ],
            boostType: 't3',
        },
    ],
    ...(config.battleConfig || {}),
}

/**
 * lab 集群的目标产物及其数量列表
 * 更新此表后所有工作中的 lab 集群都会自动合成新增的产物
 */
export const LabTarget = [
    // 基础
    { target: RESOURCE_HYDROXIDE, number: 4000 },
    { target: RESOURCE_ZYNTHIUM_KEANITE, number: 4000 },
    { target: RESOURCE_UTRIUM_LEMERGITE, number: 4000 },
    // G
    { target: RESOURCE_GHODIUM, number: 12000 },
    // XUH2O 生产线，强化 ATTACK
    { target: RESOURCE_UTRIUM_HYDRIDE, number: 4000 },
    { target: RESOURCE_UTRIUM_ACID, number: 4000 },
    { target: RESOURCE_CATALYZED_UTRIUM_ACID, number: 20000 },
    // XZHO2 生产线，强化 MOVE
    { target: RESOURCE_ZYNTHIUM_OXIDE, number: 4000 },
    { target: RESOURCE_ZYNTHIUM_ALKALIDE, number: 4000 },
    { target: RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE, number: 20000 },
    // XLH2O 生产线，强化WORK 的 repair
    { target: RESOURCE_LEMERGIUM_HYDRIDE, number: 10000 },
    { target: RESOURCE_LEMERGIUM_ACID, number: 10000 },
    { target: RESOURCE_CATALYZED_LEMERGIUM_ACID, number: 20000 },
    // XLHO2 生产线，强化 HEAL
    { target: RESOURCE_LEMERGIUM_OXIDE, number: 4000 },
    { target: RESOURCE_LEMERGIUM_ALKALIDE, number: 4000 },
    { target: RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE, number: 20000 },
    // XGHO2 生产线，强化 TOUGH
    { target: RESOURCE_GHODIUM_OXIDE, number: 4000 },
    { target: RESOURCE_GHODIUM_ALKALIDE, number: 4000 },
    { target: RESOURCE_CATALYZED_GHODIUM_ALKALIDE, number: 20000 },
    // XKHO2 生产线，强化 RANGE_ATTACK
    { target: RESOURCE_KEANIUM_OXIDE, number: 4000 },
    { target: RESOURCE_KEANIUM_ALKALIDE, number: 4000 },
    { target: RESOURCE_CATALYZED_KEANIUM_ALKALIDE, number: 20000 },
    // XGH2O 生产线，强化 WORK 的 upgrade
    { target: RESOURCE_GHODIUM_HYDRIDE, number: 10000 },
    { target: RESOURCE_GHODIUM_ACID, number: 10000 },
    { target: RESOURCE_CATALYZED_GHODIUM_ACID, number: 20000 },
    // XKH2O 生产线，强化 CARRY
    { target: RESOURCE_KEANIUM_HYDRIDE, number: 4000 },
    { target: RESOURCE_KEANIUM_ACID, number: 4000 },
    { target: RESOURCE_CATALYZED_KEANIUM_ACID, number: 20000 },
    // XZH2O 生产线，强化 WORK 的 dismantle
    { target: RESOURCE_ZYNTHIUM_HYDRIDE, number: 4000 },
    { target: RESOURCE_ZYNTHIUM_ACID, number: 4000 },
    { target: RESOURCE_CATALYZED_ZYNTHIUM_ACID, number: 20000 },
    // XUHO2 生产线，强化WORK 的 harvest
    { target: RESOURCE_UTRIUM_OXIDE, number: 4000 },
    { target: RESOURCE_UTRIUM_ALKALIDE, number: 0 },
    { target: RESOURCE_CATALYZED_UTRIUM_ALKALIDE, number: 0 },
]

/**
 * storage 中资源标准，资源低于 min 就表示不足，高于 max 就说明过剩
 */
export const StorageResourceStandard = {
    energy: [100000, 150000],
    power: [10000, 30000],

    H: [10000, 30000],
    O: [10000, 30000],
    U: [10000, 30000],
    L: [10000, 30000],
    K: [10000, 30000],
    Z: [10000, 30000],
    X: [10000, 30000],
} as const
